<!DOCTYPE html>
<html lang="en">
<head>
	<title>邮件</title>
	<meta charset="utf-8">
	<script type="text/javascript" src="/template/js/jquery.js"></script>
</head>
<body>
	<div>
		邮件<br /><br />
		<div>
			<form>
				收件人：<input type="type" class="addressee" value="" style="width: 30%" /><br /><br />
				主题：<input type="type" class="theme" value="" /><br /><br />
				内容：<textarea class="content" style="width: 30%; height: 160px;" ></textarea><br /><br />

				<input type="button" onclick="sub()" value="提交" />
			</form>
		</div>
	</div>
</body>
	<script type="text/javascript">
        function sub() {
        	var addressee = $('.addressee').val()
        	if (!addressee|| addressee == null || addressee==undefined || addressee=='undefined') {
				alert('收件人 不能为空');
				return
			}

			var theme = $('.theme').val()
        	if (!theme|| theme == null || theme==undefined || theme=='undefined') {
				alert('主题 不能为空');
				return
			}

			var content = $('.content').val()
        	if (!content|| content == null || content==undefined || content=='undefined') {
				alert('内容 不能为空');
				return
			}

			$.ajax({
			   	type: "POST",
			   	url: "/mailsend",
			   	data: "addressee="+addressee+"&theme="+theme+"&content="+content,
			   	success: function(msg){
			     	alert( msg );
			   	}
			});
        }
    </script>
</html>